00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef GGOV1_HPP
00011 #define GGOV1_HPP
00012 #include "gridpack/component/data_collection.hpp"
00013 #include "gridpack/parser/dictionary.hpp"
00014 #include "gridpack/utilities/string_utils.hpp"
00015 namespace gridpack {
00016 namespace parser {
00017 template <class _data_struct> class Ggov1Parser
00018 {
00019 public:
00020
00021
00022
00023 explicit Ggov1Parser()
00024 {
00025 }
00026
00027
00028
00029
00030 virtual ~Ggov1Parser()
00031 {
00032 }
00033
00034
00035
00036
00037
00038
00039
00040 void extract(_data_struct &data_struct,
00041 gridpack::component::DataCollection *data, int g_id)
00042 {
00043 double rval;
00044 bool bval;
00045
00046 if (!data->getValue(HAS_GOVERNOR,&bval,g_id)) {
00047 data->addValue(HAS_GOVERNOR, true, g_id);
00048 } else {
00049 data->setValue(HAS_GOVERNOR, true, g_id);
00050 }
00051
00052
00053 std::string stmp;
00054 if (!data->getValue(GOVERNOR_MODEL, &stmp, g_id)) {
00055 data->addValue(GOVERNOR_MODEL, data_struct.model, g_id);
00056 } else {
00057 data->setValue(GOVERNOR_MODEL, data_struct.model, g_id);
00058 }
00059
00060
00061 if (!data->getValue(GOVERNOR_RSELECT,&rval,g_id)) {
00062 data->addValue(GOVERNOR_RSELECT, data_struct.rselect, g_id);
00063 } else {
00064 data->setValue(GOVERNOR_RSELECT, data_struct.rselect, g_id);
00065 }
00066
00067
00068 if (!data->getValue(GOVERNOR_FLAGSWITCH,&rval,g_id)) {
00069 data->addValue(GOVERNOR_FLAGSWITCH, data_struct.flagswitch, g_id);
00070 } else {
00071 data->setValue(GOVERNOR_FLAGSWITCH, data_struct.flagswitch, g_id);
00072 }
00073
00074
00075 if (!data->getValue(GOVERNOR_R,&rval,g_id)) {
00076 data->addValue(GOVERNOR_R, data_struct.gv_r, g_id);
00077 } else {
00078 data->setValue(GOVERNOR_R, data_struct.gv_r, g_id);
00079 }
00080
00081
00082 if (!data->getValue(GOVERNOR_TPELEC,&rval,g_id)) {
00083 data->addValue(GOVERNOR_TPELEC, data_struct.tpelec, g_id);
00084 } else {
00085 data->setValue(GOVERNOR_TPELEC, data_struct.tpelec, g_id);
00086 }
00087
00088
00089 if (!data->getValue(GOVERNOR_MAXERR,&rval,g_id)) {
00090 data->addValue(GOVERNOR_MAXERR, data_struct.maxerr, g_id);
00091 } else {
00092 data->setValue(GOVERNOR_MAXERR, data_struct.maxerr, g_id);
00093 }
00094
00095
00096 if (!data->getValue(GOVERNOR_MINERR,&rval,g_id)) {
00097 data->addValue(GOVERNOR_MINERR, data_struct.minerr, g_id);
00098 } else {
00099 data->setValue(GOVERNOR_MINERR, data_struct.minerr, g_id);
00100 }
00101
00102
00103 if (!data->getValue(GOVERNOR_KPGOV,&rval,g_id)) {
00104 data->addValue(GOVERNOR_KPGOV, data_struct.kpgov, g_id);
00105 } else {
00106 data->setValue(GOVERNOR_KPGOV, data_struct.kpgov, g_id);
00107 }
00108
00109
00110 if (!data->getValue(GOVERNOR_KIGOV,&rval,g_id)) {
00111 data->addValue(GOVERNOR_KIGOV, data_struct.kigov, g_id);
00112 } else {
00113 data->setValue(GOVERNOR_KIGOV, data_struct.kigov, g_id);
00114 }
00115
00116
00117 if (!data->getValue(GOVERNOR_KDGOV,&rval,g_id)) {
00118 data->addValue(GOVERNOR_KDGOV, data_struct.kdgov, g_id);
00119 } else {
00120 data->setValue(GOVERNOR_KDGOV, data_struct.kdgov, g_id);
00121 }
00122
00123
00124 if (!data->getValue(GOVERNOR_TDGOV,&rval,g_id)) {
00125 data->addValue(GOVERNOR_TDGOV, data_struct.tdgov, g_id);
00126 } else {
00127 data->setValue(GOVERNOR_TDGOV, data_struct.tdgov, g_id);
00128 }
00129
00130
00131 if (!data->getValue(GOVERNOR_VMAX,&rval,g_id)) {
00132 data->addValue(GOVERNOR_VMAX, data_struct.vmax, g_id);
00133 } else {
00134 data->setValue(GOVERNOR_VMAX, data_struct.vmax, g_id);
00135 }
00136
00137
00138 if (!data->getValue(GOVERNOR_VMIN,&rval,g_id)) {
00139 data->addValue(GOVERNOR_VMIN, data_struct.vmin, g_id);
00140 } else {
00141 data->setValue(GOVERNOR_VMIN, data_struct.vmin, g_id);
00142 }
00143
00144
00145 if (!data->getValue(GOVERNOR_TACT,&rval,g_id)) {
00146 data->addValue(GOVERNOR_TACT, data_struct.tact, g_id);
00147 } else {
00148 data->setValue(GOVERNOR_TACT, data_struct.tact, g_id);
00149 }
00150
00151
00152 if (!data->getValue(GOVERNOR_KTURB,&rval,g_id)) {
00153 data->addValue(GOVERNOR_KTURB, data_struct.kturb, g_id);
00154 } else {
00155 data->setValue(GOVERNOR_KTURB, data_struct.kturb, g_id);
00156 }
00157
00158
00159 if (!data->getValue(GOVERNOR_WFNL,&rval,g_id)) {
00160 data->addValue(GOVERNOR_WFNL, data_struct.wfnl, g_id);
00161 } else {
00162 data->setValue(GOVERNOR_WFNL, data_struct.wfnl, g_id);
00163 }
00164
00165
00166 if (!data->getValue(GOVERNOR_TB,&rval,g_id)) {
00167 data->addValue(GOVERNOR_TB, data_struct.gv_tb, g_id);
00168 } else {
00169 data->setValue(GOVERNOR_TB, data_struct.gv_tb, g_id);
00170 }
00171
00172
00173 if (!data->getValue(GOVERNOR_TC,&rval,g_id)) {
00174 data->addValue(GOVERNOR_TC, data_struct.gv_tc, g_id);
00175 } else {
00176 data->setValue(GOVERNOR_TC, data_struct.gv_tc, g_id);
00177 }
00178
00179
00180 if (!data->getValue(GOVERNOR_TENG,&rval,g_id)) {
00181 data->addValue(GOVERNOR_TENG, data_struct.teng, g_id);
00182 } else {
00183 data->setValue(GOVERNOR_TENG, data_struct.teng, g_id);
00184 }
00185
00186
00187 if (!data->getValue(GOVERNOR_TFLOAD,&rval,g_id)) {
00188 data->addValue(GOVERNOR_TFLOAD, data_struct.tfload, g_id);
00189 } else {
00190 data->setValue(GOVERNOR_TFLOAD, data_struct.tfload, g_id);
00191 }
00192
00193
00194 if (!data->getValue(GOVERNOR_KPLOAD,&rval,g_id)) {
00195 data->addValue(GOVERNOR_KPLOAD, data_struct.kpload, g_id);
00196 } else {
00197 data->setValue(GOVERNOR_KPLOAD, data_struct.kpload, g_id);
00198 }
00199
00200
00201 if (!data->getValue(GOVERNOR_KILOAD,&rval,g_id)) {
00202 data->addValue(GOVERNOR_KILOAD, data_struct.kiload, g_id);
00203 } else {
00204 data->setValue(GOVERNOR_KILOAD, data_struct.kiload, g_id);
00205 }
00206
00207
00208 if (!data->getValue(GOVERNOR_LDREF,&rval,g_id)) {
00209 data->addValue(GOVERNOR_LDREF, data_struct.ldref, g_id);
00210 } else {
00211 data->setValue(GOVERNOR_LDREF, data_struct.ldref, g_id);
00212 }
00213
00214
00215 if (!data->getValue(GOVERNOR_DM,&rval,g_id)) {
00216 data->addValue(GOVERNOR_DM, data_struct.gv_dm, g_id);
00217 } else {
00218 data->setValue(GOVERNOR_DM, data_struct.gv_dm, g_id);
00219 }
00220
00221
00222 if (!data->getValue(GOVERNOR_ROPEN,&rval,g_id)) {
00223 data->addValue(GOVERNOR_ROPEN, data_struct.ropen, g_id);
00224 } else {
00225 data->setValue(GOVERNOR_ROPEN, data_struct.ropen, g_id);
00226 }
00227
00228
00229 if (!data->getValue(GOVERNOR_RCLOSE,&rval,g_id)) {
00230 data->addValue(GOVERNOR_RCLOSE, data_struct.rclose, g_id);
00231 } else {
00232 data->setValue(GOVERNOR_RCLOSE, data_struct.rclose, g_id);
00233 }
00234
00235
00236 if (!data->getValue(GOVERNOR_KIMW,&rval,g_id)) {
00237 data->addValue(GOVERNOR_KIMW, data_struct.kimw, g_id);
00238 } else {
00239 data->setValue(GOVERNOR_KIMW, data_struct.kimw, g_id);
00240 }
00241
00242
00243 if (!data->getValue(GOVERNOR_ASET,&rval,g_id)) {
00244 data->addValue(GOVERNOR_ASET, data_struct.aset, g_id);
00245 } else {
00246 data->setValue(GOVERNOR_ASET, data_struct.aset, g_id);
00247 }
00248
00249
00250 if (!data->getValue(GOVERNOR_KA,&rval,g_id)) {
00251 data->addValue(GOVERNOR_KA, data_struct.gv_ka, g_id);
00252 } else {
00253 data->setValue(GOVERNOR_KA, data_struct.gv_ka, g_id);
00254 }
00255
00256
00257 if (!data->getValue(GOVERNOR_TA,&rval,g_id)) {
00258 data->addValue(GOVERNOR_TA, data_struct.gv_ta, g_id);
00259 } else {
00260 data->setValue(GOVERNOR_TA, data_struct.gv_ta, g_id);
00261 }
00262
00263
00264 if (!data->getValue(GOVERNOR_TRATE,&rval,g_id)) {
00265 data->addValue(GOVERNOR_TRATE, data_struct.trate, g_id);
00266 } else {
00267 data->setValue(GOVERNOR_TRATE, data_struct.trate, g_id);
00268 }
00269
00270
00271 if (!data->getValue(GOVERNOR_DB,&rval,g_id)) {
00272 data->addValue(GOVERNOR_DB, data_struct.gv_db, g_id);
00273 } else {
00274 data->setValue(GOVERNOR_DB, data_struct.gv_db, g_id);
00275 }
00276
00277
00278 if (!data->getValue(GOVERNOR_TSA,&rval,g_id)) {
00279 data->addValue(GOVERNOR_TSA, data_struct.tsa, g_id);
00280 } else {
00281 data->setValue(GOVERNOR_TSA, data_struct.tsa, g_id);
00282 }
00283
00284
00285 if (!data->getValue(GOVERNOR_TSB,&rval,g_id)) {
00286 data->addValue(GOVERNOR_TSB, data_struct.tsb, g_id);
00287 } else {
00288 data->setValue(GOVERNOR_TSB, data_struct.tsb, g_id);
00289 }
00290
00291
00292 if (!data->getValue(GOVERNOR_RUP,&rval,g_id)) {
00293 data->addValue(GOVERNOR_RUP, data_struct.rup, g_id);
00294 } else {
00295 data->setValue(GOVERNOR_RUP, data_struct.rup, g_id);
00296 }
00297
00298
00299 if (!data->getValue(GOVERNOR_RDOWN,&rval,g_id)) {
00300 data->addValue(GOVERNOR_RDOWN, data_struct.rdown, g_id);
00301 } else {
00302 data->setValue(GOVERNOR_RDOWN, data_struct.rdown, g_id);
00303 }
00304 }
00305
00306
00307
00308
00309
00310
00311
00312 void parse(std::vector<std::string> &split_line,
00313 gridpack::component::DataCollection *data, int g_id)
00314 {
00315 double rval;
00316 int nstr = split_line.size();
00317 bool bval;
00318
00319 if (!data->getValue(HAS_GOVERNOR,&bval,g_id)) {
00320 data->addValue(HAS_GOVERNOR, true, g_id);
00321 } else {
00322 data->setValue(HAS_GOVERNOR, true, g_id);
00323 }
00324
00325
00326 std::string stmp, model;
00327 gridpack::utility::StringUtils util;
00328 model = util.trimQuotes(split_line[1]);
00329 util.toUpper(model);
00330 if (!data->getValue(GOVERNOR_MODEL,&stmp,g_id)) {
00331 data->addValue(GOVERNOR_MODEL, model.c_str(), g_id);
00332 } else {
00333 data->setValue(GOVERNOR_MODEL, model.c_str(), g_id);
00334 }
00335
00336
00337 if (nstr > 3) {
00338 if (!data->getValue(GOVERNOR_RSELECT,&rval,g_id)) {
00339 data->addValue(GOVERNOR_RSELECT,
00340 atof(split_line[3].c_str()), g_id);
00341 } else {
00342 data->setValue(GOVERNOR_RSELECT,
00343 atof(split_line[3].c_str()), g_id);
00344 }
00345 }
00346
00347
00348 if (nstr > 4) {
00349 if (!data->getValue(GOVERNOR_FLAGSWITCH,&rval,g_id)) {
00350 data->addValue(GOVERNOR_FLAGSWITCH,
00351 atof(split_line[4].c_str()), g_id);
00352 } else {
00353 data->setValue(GOVERNOR_FLAGSWITCH,
00354 atof(split_line[4].c_str()), g_id);
00355 }
00356 }
00357
00358
00359 if (nstr > 5) {
00360 if (!data->getValue(GOVERNOR_R,&rval,g_id)) {
00361 data->addValue(GOVERNOR_R,
00362 atof(split_line[5].c_str()), g_id);
00363 } else {
00364 data->setValue(GOVERNOR_R,
00365 atof(split_line[5].c_str()), g_id);
00366 }
00367 }
00368
00369
00370 if (nstr > 6) {
00371 if (!data->getValue(GOVERNOR_TPELEC,&rval,g_id)) {
00372 data->addValue(GOVERNOR_TPELEC,
00373 atof(split_line[6].c_str()), g_id);
00374 } else {
00375 data->setValue(GOVERNOR_TPELEC,
00376 atof(split_line[6].c_str()), g_id);
00377 }
00378 }
00379
00380
00381 if (nstr > 7) {
00382 if (!data->getValue(GOVERNOR_MAXERR,&rval,g_id)) {
00383 data->addValue(GOVERNOR_MAXERR,
00384 atof(split_line[7].c_str()), g_id);
00385 } else {
00386 data->setValue(GOVERNOR_MAXERR,
00387 atof(split_line[7].c_str()), g_id);
00388 }
00389 }
00390
00391
00392 if (nstr > 8) {
00393 if (!data->getValue(GOVERNOR_MINERR,&rval,g_id)) {
00394 data->addValue(GOVERNOR_MINERR,
00395 atof(split_line[8].c_str()), g_id);
00396 } else {
00397 data->setValue(GOVERNOR_MINERR,
00398 atof(split_line[8].c_str()), g_id);
00399 }
00400 }
00401
00402
00403 if (nstr > 9) {
00404 if (!data->getValue(GOVERNOR_KPGOV,&rval,g_id)) {
00405 data->addValue(GOVERNOR_KPGOV,
00406 atof(split_line[9].c_str()), g_id);
00407 } else {
00408 data->setValue(GOVERNOR_KPGOV,
00409 atof(split_line[9].c_str()), g_id);
00410 }
00411 }
00412
00413
00414 if (nstr > 10) {
00415 if (!data->getValue(GOVERNOR_KIGOV,&rval,g_id)) {
00416 data->addValue(GOVERNOR_KIGOV,
00417 atof(split_line[10].c_str()), g_id);
00418 } else {
00419 data->setValue(GOVERNOR_KIGOV,
00420 atof(split_line[10].c_str()), g_id);
00421 }
00422 }
00423
00424
00425 if (nstr > 11) {
00426 if (!data->getValue(GOVERNOR_KDGOV,&rval,g_id)) {
00427 data->addValue(GOVERNOR_KDGOV,
00428 atof(split_line[11].c_str()), g_id);
00429 } else {
00430 data->setValue(GOVERNOR_KDGOV,
00431 atof(split_line[11].c_str()), g_id);
00432 }
00433 }
00434
00435
00436 if (nstr > 12) {
00437 if (!data->getValue(GOVERNOR_TDGOV,&rval,g_id)) {
00438 data->addValue(GOVERNOR_TDGOV,
00439 atof(split_line[12].c_str()), g_id);
00440 } else {
00441 data->setValue(GOVERNOR_TDGOV,
00442 atof(split_line[12].c_str()), g_id);
00443 }
00444 }
00445
00446
00447 if (nstr > 13) {
00448 if (!data->getValue(GOVERNOR_VMAX,&rval,g_id)) {
00449 data->addValue(GOVERNOR_VMAX,
00450 atof(split_line[13].c_str()), g_id);
00451 } else {
00452 data->setValue(GOVERNOR_VMAX,
00453 atof(split_line[13].c_str()), g_id);
00454 }
00455 }
00456
00457
00458 if (nstr > 14) {
00459 if (!data->getValue(GOVERNOR_VMIN,&rval,g_id)) {
00460 data->addValue(GOVERNOR_VMIN,
00461 atof(split_line[14].c_str()), g_id);
00462 } else {
00463 data->setValue(GOVERNOR_VMIN,
00464 atof(split_line[14].c_str()), g_id);
00465 }
00466 }
00467
00468
00469 if (nstr > 15) {
00470 if (!data->getValue(GOVERNOR_TACT,&rval,g_id)) {
00471 data->addValue(GOVERNOR_TACT,
00472 atof(split_line[15].c_str()), g_id);
00473 } else {
00474 data->setValue(GOVERNOR_TACT,
00475 atof(split_line[15].c_str()), g_id);
00476 }
00477 }
00478
00479
00480 if (nstr > 16) {
00481 if (!data->getValue(GOVERNOR_KTURB,&rval,g_id)) {
00482 data->addValue(GOVERNOR_KTURB,
00483 atof(split_line[16].c_str()), g_id);
00484 } else {
00485 data->setValue(GOVERNOR_KTURB,
00486 atof(split_line[16].c_str()), g_id);
00487 }
00488 }
00489
00490
00491 if (nstr > 17) {
00492 if (!data->getValue(GOVERNOR_WFNL,&rval,g_id)) {
00493 data->addValue(GOVERNOR_WFNL,
00494 atof(split_line[17].c_str()), g_id);
00495 } else {
00496 data->setValue(GOVERNOR_WFNL,
00497 atof(split_line[17].c_str()), g_id);
00498 }
00499 }
00500
00501
00502 if (nstr > 18) {
00503 if (!data->getValue(GOVERNOR_TB,&rval,g_id)) {
00504 data->addValue(GOVERNOR_TB,
00505 atof(split_line[18].c_str()), g_id);
00506 } else {
00507 data->setValue(GOVERNOR_TB,
00508 atof(split_line[18].c_str()), g_id);
00509 }
00510 }
00511
00512
00513 if (nstr > 19) {
00514 if (!data->getValue(GOVERNOR_TC,&rval,g_id)) {
00515 data->addValue(GOVERNOR_TC,
00516 atof(split_line[19].c_str()), g_id);
00517 } else {
00518 data->setValue(GOVERNOR_TC,
00519 atof(split_line[19].c_str()), g_id);
00520 }
00521 }
00522
00523
00524 if (nstr > 20) {
00525 if (!data->getValue(GOVERNOR_TENG,&rval,g_id)) {
00526 data->addValue(GOVERNOR_TENG,
00527 atof(split_line[20].c_str()), g_id);
00528 } else {
00529 data->setValue(GOVERNOR_TENG,
00530 atof(split_line[20].c_str()), g_id);
00531 }
00532 }
00533
00534
00535 if (nstr > 21) {
00536 if (!data->getValue(GOVERNOR_TFLOAD,&rval,g_id)) {
00537 data->addValue(GOVERNOR_TFLOAD,
00538 atof(split_line[21].c_str()), g_id);
00539 } else {
00540 data->setValue(GOVERNOR_TFLOAD,
00541 atof(split_line[21].c_str()), g_id);
00542 }
00543 }
00544
00545
00546 if (nstr > 22) {
00547 if (!data->getValue(GOVERNOR_KPLOAD,&rval,g_id)) {
00548 data->addValue(GOVERNOR_KPLOAD,
00549 atof(split_line[22].c_str()), g_id);
00550 } else {
00551 data->setValue(GOVERNOR_KPLOAD,
00552 atof(split_line[22].c_str()), g_id);
00553 }
00554 }
00555
00556
00557 if (nstr > 23) {
00558 if (!data->getValue(GOVERNOR_KILOAD,&rval,g_id)) {
00559 data->addValue(GOVERNOR_KILOAD,
00560 atof(split_line[23].c_str()), g_id);
00561 } else {
00562 data->setValue(GOVERNOR_KILOAD,
00563 atof(split_line[23].c_str()), g_id);
00564 }
00565 }
00566
00567
00568 if (nstr > 24) {
00569 if (!data->getValue(GOVERNOR_LDREF,&rval,g_id)) {
00570 data->addValue(GOVERNOR_LDREF,
00571 atof(split_line[24].c_str()), g_id);
00572 } else {
00573 data->setValue(GOVERNOR_LDREF,
00574 atof(split_line[24].c_str()), g_id);
00575 }
00576 }
00577
00578
00579 if (nstr > 25) {
00580 if (!data->getValue(GOVERNOR_DM,&rval,g_id)) {
00581 data->addValue(GOVERNOR_DM,
00582 atof(split_line[25].c_str()), g_id);
00583 } else {
00584 data->setValue(GOVERNOR_DM,
00585 atof(split_line[25].c_str()), g_id);
00586 }
00587 }
00588
00589
00590 if (nstr > 26) {
00591 if (!data->getValue(GOVERNOR_ROPEN,&rval,g_id)) {
00592 data->addValue(GOVERNOR_ROPEN,
00593 atof(split_line[26].c_str()), g_id);
00594 } else {
00595 data->setValue(GOVERNOR_ROPEN,
00596 atof(split_line[26].c_str()), g_id);
00597 }
00598 }
00599
00600
00601 if (nstr > 27) {
00602 if (!data->getValue(GOVERNOR_RCLOSE,&rval,g_id)) {
00603 data->addValue(GOVERNOR_RCLOSE,
00604 atof(split_line[27].c_str()), g_id);
00605 } else {
00606 data->setValue(GOVERNOR_RCLOSE,
00607 atof(split_line[27].c_str()), g_id);
00608 }
00609 }
00610
00611
00612 if (nstr > 28) {
00613 if (!data->getValue(GOVERNOR_KIMW,&rval,g_id)) {
00614 data->addValue(GOVERNOR_KIMW,
00615 atof(split_line[28].c_str()), g_id);
00616 } else {
00617 data->setValue(GOVERNOR_KIMW,
00618 atof(split_line[28].c_str()), g_id);
00619 }
00620 }
00621
00622
00623 if (nstr > 29) {
00624 if (!data->getValue(GOVERNOR_ASET,&rval,g_id)) {
00625 data->addValue(GOVERNOR_ASET,
00626 atof(split_line[29].c_str()), g_id);
00627 } else {
00628 data->setValue(GOVERNOR_ASET,
00629 atof(split_line[29].c_str()), g_id);
00630 }
00631 }
00632
00633
00634 if (nstr > 30) {
00635 if (!data->getValue(GOVERNOR_KA,&rval,g_id)) {
00636 data->addValue(GOVERNOR_KA,
00637 atof(split_line[30].c_str()), g_id);
00638 } else {
00639 data->setValue(GOVERNOR_KA,
00640 atof(split_line[30].c_str()), g_id);
00641 }
00642 }
00643
00644
00645 if (nstr > 31) {
00646 if (!data->getValue(GOVERNOR_TA,&rval,g_id)) {
00647 data->addValue(GOVERNOR_TA,
00648 atof(split_line[31].c_str()), g_id);
00649 } else {
00650 data->setValue(GOVERNOR_TA,
00651 atof(split_line[31].c_str()), g_id);
00652 }
00653 }
00654
00655
00656 if (nstr > 32) {
00657 if (!data->getValue(GOVERNOR_TRATE,&rval,g_id)) {
00658 data->addValue(GOVERNOR_TRATE,
00659 atof(split_line[32].c_str()), g_id);
00660 } else {
00661 data->setValue(GOVERNOR_TRATE,
00662 atof(split_line[32].c_str()), g_id);
00663 }
00664 }
00665
00666
00667 if (nstr > 33) {
00668 if (!data->getValue(GOVERNOR_DB,&rval,g_id)) {
00669 data->addValue(GOVERNOR_DB,
00670 atof(split_line[33].c_str()), g_id);
00671 } else {
00672 data->setValue(GOVERNOR_DB,
00673 atof(split_line[33].c_str()), g_id);
00674 }
00675 }
00676
00677
00678 if (nstr > 34) {
00679 if (!data->getValue(GOVERNOR_TSA,&rval,g_id)) {
00680 data->addValue(GOVERNOR_TSA,
00681 atof(split_line[34].c_str()), g_id);
00682 } else {
00683 data->setValue(GOVERNOR_TSA,
00684 atof(split_line[34].c_str()), g_id);
00685 }
00686 }
00687
00688
00689 if (nstr > 35) {
00690 if (!data->getValue(GOVERNOR_TSB,&rval,g_id)) {
00691 data->addValue(GOVERNOR_TSB,
00692 atof(split_line[35].c_str()), g_id);
00693 } else {
00694 data->setValue(GOVERNOR_TSB,
00695 atof(split_line[35].c_str()), g_id);
00696 }
00697 }
00698
00699
00700 if (nstr > 36) {
00701 if (!data->getValue(GOVERNOR_RUP,&rval,g_id)) {
00702 data->addValue(GOVERNOR_RUP,
00703 atof(split_line[36].c_str()), g_id);
00704 } else {
00705 data->setValue(GOVERNOR_RUP,
00706 atof(split_line[36].c_str()), g_id);
00707 }
00708 }
00709
00710
00711 if (nstr > 37) {
00712 if (!data->getValue(GOVERNOR_RDOWN,&rval,g_id)) {
00713 data->addValue(GOVERNOR_RDOWN,
00714 atof(split_line[37].c_str()), g_id);
00715 } else {
00716 data->setValue(GOVERNOR_RDOWN,
00717 atof(split_line[37].c_str()), g_id);
00718 }
00719 }
00720 }
00721
00722
00723
00724
00725
00726
00727 void store(std::vector<std::string> &split_line,_data_struct &data)
00728 {
00729
00730 int o_idx;
00731 o_idx = atoi(split_line[0].c_str());
00732 data.bus_id = o_idx;
00733
00734
00735 gridpack::utility::StringUtils util;
00736 std::string tag = util.clean2Char(split_line[2]);
00737 strcpy(data.gen_id, tag.c_str());
00738
00739 std::string sval;
00740 sval = util.trimQuotes(split_line[1]);
00741 util.toUpper(sval);
00742
00743
00744 strcpy(data.model, sval.c_str());
00745
00746 int nstr = split_line.size();
00747
00748 if (nstr > 3) {
00749 data.rselect = atof(split_line[3].c_str());
00750 }
00751
00752
00753 if (nstr > 4) {
00754 data.flagswitch = atof(split_line[4].c_str());
00755 }
00756
00757
00758 if (nstr > 5) {
00759 data.gv_r = atof(split_line[5].c_str());
00760 }
00761
00762
00763 if (nstr > 6) {
00764 data.tpelec = atof(split_line[6].c_str());
00765 }
00766
00767
00768 if (nstr > 7) {
00769 data.maxerr = atof(split_line[7].c_str());
00770 }
00771
00772
00773 if (nstr > 8) {
00774 data.minerr = atof(split_line[8].c_str());
00775 }
00776
00777
00778 if (nstr > 9) {
00779 data.kpgov = atof(split_line[9].c_str());
00780 }
00781
00782
00783 if (nstr > 10) {
00784 data.kigov = atof(split_line[10].c_str());
00785 }
00786
00787
00788 if (nstr > 11) {
00789 data.kdgov = atof(split_line[11].c_str());
00790 }
00791
00792
00793 if (nstr > 12) {
00794 data.tdgov = atof(split_line[12].c_str());
00795 }
00796
00797
00798 if (nstr > 13) {
00799 data.vmax = atof(split_line[13].c_str());
00800 }
00801
00802
00803 if (nstr > 14) {
00804 data.vmin = atof(split_line[14].c_str());
00805 }
00806
00807
00808 if (nstr > 15) {
00809 data.tact = atof(split_line[15].c_str());
00810 }
00811
00812
00813 if (nstr > 16) {
00814 data.kturb = atof(split_line[16].c_str());
00815 }
00816
00817
00818 if (nstr > 17) {
00819 data.wfnl = atof(split_line[17].c_str());
00820 }
00821
00822
00823 if (nstr > 18) {
00824 data.gv_tb = atof(split_line[18].c_str());
00825 }
00826
00827
00828 if (nstr > 19) {
00829 data.gv_tc = atof(split_line[19].c_str());
00830 }
00831
00832
00833 if (nstr > 20) {
00834 data.teng = atof(split_line[20].c_str());
00835 }
00836
00837
00838 if (nstr > 21) {
00839 data.tfload = atof(split_line[21].c_str());
00840 }
00841
00842
00843 if (nstr > 22) {
00844 data.kpload = atof(split_line[22].c_str());
00845 }
00846
00847
00848 if (nstr > 23) {
00849 data.kiload = atof(split_line[23].c_str());
00850 }
00851
00852
00853 if (nstr > 24) {
00854 data.ldref = atof(split_line[24].c_str());
00855 }
00856
00857
00858 if (nstr > 25) {
00859 data.gv_dm = atof(split_line[25].c_str());
00860 }
00861
00862
00863 if (nstr > 26) {
00864 data.ropen = atof(split_line[26].c_str());
00865 }
00866
00867
00868 if (nstr > 27) {
00869 data.rclose = atof(split_line[27].c_str());
00870 }
00871
00872
00873 if (nstr > 28) {
00874 data.kimw = atof(split_line[28].c_str());
00875 }
00876
00877
00878 if (nstr > 29) {
00879 data.aset = atof(split_line[29].c_str());
00880 }
00881
00882
00883 if (nstr > 30) {
00884 data.gv_ka = atof(split_line[30].c_str());
00885 }
00886
00887
00888 if (nstr > 31) {
00889 data.gv_ta = atof(split_line[31].c_str());
00890 }
00891
00892
00893 if (nstr > 32) {
00894 data.trate = atof(split_line[32].c_str());
00895 }
00896
00897
00898 if (nstr > 33) {
00899 data.gv_db = atof(split_line[33].c_str());
00900 }
00901
00902
00903 if (nstr > 34) {
00904 data.tsa = atof(split_line[34].c_str());
00905 }
00906
00907
00908 if (nstr > 35) {
00909 data.tsb = atof(split_line[35].c_str());
00910 }
00911
00912
00913 if (nstr > 36) {
00914 data.rup = atof(split_line[36].c_str());
00915 }
00916
00917
00918 if (nstr > 37) {
00919 data.rdown = atof(split_line[37].c_str());
00920 }
00921 }
00922 };
00923 }
00924 }
00925 #endif